import Textarea from "@ui/RJMart/textarea";


export default function TextAreaItem(props) {
    const {title, placeholder ,index,handleChange,name,noStar,tips,unit,isTextArea}=props
    let formData=props.formData
    //
    // function addName() {
    //     let inputEle=document.querySelector(`.bid-inputbid-inputs-input>div[name=${name}] input`);
    //     if(inputEle){
    //         inputEle.setAttribute('name',name);
    //     }
    // }
    //
    React.useEffect(() => {
        // addName();

    }, []);


    // const isValid=formData.$$status.hasOwnProperty(name)&&formData.$$status[name]? false:true

    return(
        <div>
            <div className={'bid-inputbid-textrea-wrapper'}>
                <div className={'bid-inputbid-label3-box'}>
                    <span className={'bid-inputbid-label'}>{title}</span>
                    <span className={'bid-inputbid-dots'}>:</span>
                </div>
                <div className={'bid-inputbid-textarea-input'}>
                    <Textarea
                        className={'bid-inputbid-textarea'}
                        name={name}
                        placeholder={placeholder}
                        onChange={handleChange}
                        maxlength={200}
                    />

                    <div className={'bid-inputbid-inputs-right'}>
                        <span className={'bid-inputbid-inputs-r-unit'}>{unit}</span>
                        <span className={'bid-inputbid-inputs-r-tips'}>{tips}</span>
                    </div>
                </div>
            </div>
            {/*{*/}
            {/*    !isValid&& <p className={'bid-inputbid-error-tip'}>{formData.$$status[name]}</p>*/}
            {/*}*/}

        </div>

    )
}